import * as API from "@/utils/axios";

export const paramType ={
    'connect':'/stream/connect/',// 获取视频监控地址
    'keepLive':'/stream/keepLive/',// 视频保活
    'realTimeData':'/visualization/homePage/getInfo',// 实时数据
    'policeData':'/visualization/homePage/getPolice',// 报警首页列表
    'policeAllData':'/visualization/police/getPolice',// 报警列表
    'section':'/visualization/radar/section',// 查询煤流当前截面图
    'trend':'/visualization/radar/trend',// 查询煤流厚度趋势
    'average':'/visualization/radar/averageThickness',// 查询煤流60分钟内平均
    'proportion':'/visualization/recognition/proportion',// 查询煤流占比30分钟内变化趋势
    'sieveInfo':'/visualization/sieve/info',// 查询煤流占比30分钟内变化趋势
    'power':'/visualization/sensor/power',// 查询电机功率30分钟内变化趋势
    'temperature':'/visualization/sensor/temperature',// 查询温度30分钟内变化趋势
    'startFlag':'/visualization/sieve/startFlag',// 查询系统启动时间
    'contrast':'/visualization/statistics/contrast',// 查询系统启动时间
    'getDeviceInfo':'/visualization/device/getDeviceInfo', // 获取筛机信息
    'getCamera':'/visualization/device/getCamera', // 获取摄像头信息
    'configDensity':'/visualization/device/config', // 配置密度信息
    'brokenLineData':'/visualization/scale/brokenLineData', // 胶带秤折线图
    'scaleDevice':'/visualization/device/getAllScale', // 胶带秤信息
    'screeningMachineInfo':'/screen/deviceInfo', //筛板信息

}
/******************      通用增删改查       ********************* */

/**
 * 通用GET
 * @param {*} param
 */
export const GET = (key,param)=> {
    return API.GET(paramType[key], param)
}

/**
 * 通用GET
 */
export const GET_RESTFUL =  (key,param)=> {
    return API.GET(paramType[key]+'/'+param,{})
}
/**
 * 通用POST
 * @param {*} param
 */
export const POST =  (key,param)=> {
    return API.POST(paramType[key], param)
}

export const PUT = (key,param) =>{
    return API.PUT(paramType[key], param)
}

export const DELETE = (key,param) =>{
    return API.DELETE(paramType[key], param)
}
// 通用接口集合
export const Api= {
    GET,
    GET_RESTFUL,
    POST,
    PUT,
    DELETE,
}